#######Scatter plot of SigmaNT/SigmaTH with NH2 ###########
set terminal epslatex color standalone lw 1 header '\renewcommand{\normalsize}{\scriptsize}  \usepackage{txfonts} \newcommand{\dd}{\mathrm{d}}'
set output"sntth_nh.tex"

line(x)=k*x+b
power(x)=a*(x**p)

unset logscale

set xrange [0:18]
set yrange [0:5]

set xlabel '$N_{H_2}\ (10^{21}\ \mathrm{cm^{-2}})$'
set ylabel '$\sigma_{NT}/\sigma_{Therm}\ (\mathrm{km\ s^{-1}})$'

set key box
set key right at graph 0.98,0.17
set key width -15.5

fit [0:18] line(x) 'all.txt' using 3:11 via 'line.par'      
fit [0:18] power(x) 'all.txt' using 3:11 via 'power.par'

plot"core.txt" using 5:17 w p pt 19 title "Core" , \
"diffuse.txt" using 5:13 w p pt 7 title "Diffuse" , \
line(x)  lw 1 lc 3 lt 2 title '$y=(0.14 \pm 0.03)x+(1.8 \pm 0.1), R^2=0.68$', \
power(x) with line lt 1 title '$y=(1.6 \pm 0.1)x^{0.30 \pm 0.05}, R^2=0.86$'

set terminal wxt enhanced
set output

#######Scatter plot of Sigma3D with NH2 ###########
set terminal epslatex color standalone lw 1 header '\renewcommand{\normalsize}{\scriptsize}  \usepackage{txfonts} \newcommand{\dd}{\mathrm{d}}'
set output"s3D_nh2.tex"
set label 1 "TMC" at graph 0.1,0.9
line(x)=k*x+b
power(x)=a*(x**p)

unset logscale

set xrange [0:10]
set yrange [0:1.2]

set xlabel '$N_{H_2}\ (10^{21}\ \mathrm{cm^{-2}})$'
set ylabel '$\sigma_{3D}\ (\mathrm{km\ s^{-1}})$'

unset key box
#set key right at graph 0.98,0.17
#set key width -17.2

fit [0:18] line(x) 'tmc.txt' using 5:8 via 'line.par'      
fit [0:18] power(x) 'tmc.txt' using 5:8 via 'power.par'

plot"tmc.txt" using 5:8 w p pt 19 , \
line(x)  lw 1 lc 3 lt 2 , \
power(x) with line lt 1 

set terminal wxt enhanced
set output

